<template>
  <ul class="contact-container">
    <li>
      <a :href="data.github" target="_blank">
        <div class="icon">
          <Icon type="github" />
        </div>
        <span>{{data.githubName}}的gitee</span>
      </a>
    </li>

    <li>
      <a href="mailto:2641748926@qq.com">
        <div class="icon">
          <Icon type="mail" />
        </div>
        <span>{{data.mail}}</span>
      </a>
    </li>

    <li>
      <a
        :href="`tencent://message/?Menu=yes&uin=${data.qq}&Service=300&sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45`"
      >
        <div class="icon">
          <Icon type="qq"></Icon>
        </div>
        <span>{{data.qq}}</span>
      </a>
      <div class="pop">
        <img
          :src="data.qqQrCode"
          alt=""
        />
      </div>
    </li>

    <li>
      <a>
        <div class="icon weixin">
          <Icon type="weixin" />
        </div>
        <span>{{data.weixin}}</span>
      </a>
      <div class="pop">
        <img
          :src="data.weixinQrCode"
        />
      </div>
    </li>
  </ul>
</template>

<script>
import Icon from "@/components/Icon";
import {mapState} from "vuex";

export default {
  name: "Contact",
  components: {
    Icon,
  },
  computed: {
    ...mapState("setting", ["data", "loading"])
  }
};
</script>

<style lang="less" scoped>
@import "~@/styles/var.less";

.contact-container {
  @itemHeight: 30px;

  width: 100%;
  background-color: transparent;
  list-style: none;
  padding: 20px;
  margin: 0;
  color: @gray;

  li {
    height: @itemHeight;
    line-height: @itemHeight;
    margin: 14px 0;
    position: relative;

    &:hover {
      .pop {
        transform: scaleY(1);
      }
    }
  }

  a {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
  }

  .icon {
    font-size: 26px;
    width: 36px;
  }

  .pop {
    position: absolute;
    left: 0;
    bottom: @itemHeight + 7px;
    padding: 15px 20px;
    background-color: #fff;
    border-radius: 5px;
    font-size: 0;
    line-height: normal;
    transition: all 0.3s;
    transform: scaleY(0);
    transform-origin: center bottom;
    img {
      width: 140px;
      height: 140px;
    }

    &::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -4px;
      transform: translateX(-50%) rotate(45deg);

      width: 10px;
      height: 10px;
      background-color: #fff;
    }
  }
}
</style>
